﻿CREATE TABLE [dbo].[tblTransactionSubmit]
(
	TransactionSubmitID int not null primary key identity(1,1),
	TransactionID int not null,
	[TransactionSubmitTypeCode] char(1) not null,
	[Decision]				CHAR(1),
    [TransactionResponseID] INT           NULL,
	[TransactionResponse]   NVARCHAR (2000) NULL,
    [AVSResponse]           CHAR (2)      NULL,
    [CVV2Response]          CHAR (1)      NULL,
	[CreateDate]	smalldatetime not null,
    [ResponseDate]          SMALLDATETIME NULL,
	[SubmissionCount] int null
)
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Defines a submission of a transaction to a payment processor for processing.', @level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblTransactionSubmit';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'primary key.  Uniquely identifies each TransactionSubmit.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblTransactionSubmit',
	@level2type = N'COLUMN', @level2name = N'TransactionSubmitID';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Links to tblTransaction.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblTransactionSubmit',
	@level2type = N'COLUMN', @level2name = N'TransactionID';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'A for Authorization, D for Deposit.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblTransactionSubmit',
	@level2type = N'COLUMN', @level2name = N'TransactionSubmitTypeCode';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'A - Accepted, D - Declined, E - Error, H - Held for review', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblTransactionSubmit',
	@level2type = N'COLUMN', @level2name = N'Decision';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Links to codeTransactionResponse.  This defines the response to the submission from the payment processor.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblTransactionSubmit',
	@level2type = N'COLUMN', @level2name = N'TransactionResponseID';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The address verification response.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblTransactionSubmit',
	@level2type = N'COLUMN', @level2name = N'AVSResponse';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The CVV2 Response.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblTransactionSubmit',
	@level2type = N'COLUMN', @level2name = N'CVV2Response';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The Date/Time the record was created.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblTransactionSubmit',
	@level2type = N'COLUMN', @level2name = N'CreateDate';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The Date/Time the response was received from the payment processor.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblTransactionSubmit',
	@level2type = N'COLUMN', @level2name = N'ResponseDate';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The number of times that the submission has been tried.  The first submission has a SubmissionCount of 1.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblTransactionSubmit',
	@level2type = N'COLUMN', @level2name = N'SubmissionCount';
GO;
